package br.net.woodstock.tickettoride.spring.web;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

import br.net.woodstock.rockframework.web.struts2.util.DownloadableAction;

public class DownloadAction extends AbstractApplicationAction implements DownloadableAction {

	private static final long	serialVersionUID	= 1L;

	private InputStream			inputStream;

	private String				contentType;

	private String				contentDisposition;

	@Override
	public InputStream getInputStream() {
		return this.inputStream;
	}

	public void setInputStream(final InputStream inputStream) {
		this.inputStream = inputStream;
	}

	public void setInputStream(final File file) throws FileNotFoundException {
		this.inputStream = new FileInputStream(file);
	}

	@Override
	public String getContentType() {
		return this.contentType;
	}

	public void setContentType(final String contentType) {
		this.contentType = contentType;
	}

	@Override
	public String getContentDisposition() {
		return this.contentDisposition;
	}

	public void setContentDisposition(final String contentDisposition) {
		this.contentDisposition = contentDisposition;
	}

}
